<template>
    <div>
        <h1>左边yangyang</h1>
    </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue';
import { useRoute, useRouter } from "vue-router";

export default defineComponent({
    setup() {
        const route = useRoute();
        console.log(route);
        console.log(route.query.id);
        // console.log(route.query.value.id);//报错

        const router = useRouter();
        console.log(router);
        // 获取到router之后能操作 编程式路由导航 路由守卫
        return {}
    },
    mounted() {
        console.log(this.$route);
    },
})
</script>

<style scoped>

</style>